The present invention relates to the field of computer graphics. In particular the present invention discloses a method and apparatus for modeling and rendering three-dimensional surfaces.
An object is commonly represented in computer graphics by a mesh of polygonal facets with the connected polygons sharing edges and vertices. These may be derived from more algebraically complex surface representations, but creation of an actual image usually goes through a mesh representation. The facets are an approximation to the curved surfaces of such object. The polygon mesh forms the exterior of the object. The accuracy of the model, or the difference between the faceted representation and the curved surface of the object to be represented, depends on many factors, and the intended use. For example, a picture of the object usually requires less accuracy than an engineering specification of it. Where the curvature changes rapidly, more polygons are required per unit area of the surface. Complex surfaces often require tens or hundreds of thousands of polygons to be represented in this manner. A polygon mesh structure consists of many vertices with their (x,y,z) coordinates, and polygons which share these vertices. More simply but less efficiently, each polygon may have the (x,y,z) coordinates of its vertices listed directly.
For an object to be drawn, the model must contain not only a mesh structure hut information about the normal direction at each point which affects how it meets light, the light-scattering properties, and the color. Typically, the color is specified either by fixing a color at each vertex, and for the other points on each polygon interpolating between its vertices, or by specifying for each vertex a position in a buffered image or xe2x80x982D texturexe2x80x99. For other points of each polygon these positions are interpolated, and the color read from the 2D texture.
Another method to render surfaces is bump mapping. Bump mapping is a technique to enable representation of a wrinkled or dimpled surface without the need to model these depressions geometrically. Using information given in a two-dimensional bump map, this technique tricks a local reflection model into producing local variations on a smooth surface. This technique defines a map of normal vectors across the surface of the polygons. Normal vectors are used to represent the orientation of a surface when comparing with the direction of the light. Such a comparison is used in shading models to compute the intensity of the light reflected from a matte (uniform scattering) surface. The smaller the angle between the light vector and the vector that is normal to the surface. the higher is the intensity of the light received by and therefore scattered from the surface. The normal vectors for the vertices can be computed directly from the neighboring surface normals by various averaging techniques, but it is more usual to include normals (obtained by a variety of methods) in the data structure than to recompute them for each image. xe2x80x98Shinyxe2x80x99 surfaces, reflecting light more strongly in the direction that a mirror would, require also comparisons of the direction with the eye""s direction of viewpoint.
In bump mapping, normals assigned according to position in the polygon, giving a point in a 2D map of normals analogous to 2D texture coloring, are used to modify the lighting of the rasterized points to simulate surface variation. However they do not capture the position of surface points correctly. Bump mapping works best for polygons that are perpendicular to the viewing direction; those seen at an oblique angle do not display the correct silhouette.
In one embodiment, a method and apparatus for modeling a three-dimensional surface is disclosed. A polygon mesh approximates the three-dimensional surface. Each polygon of the polygon mesh contains a plurality of footpoints. A normal vector is associated with each vertex of the polygons. An interpolated normal is associated with each footpoint with the interpolation based on the vertex normals of the polygon containing the footpoint. Each point on the three-dimensional surface is represented by a height datum given as a function of a footpoint on a polygon. The height datum represents a distance along an interpolated normal from the footpoint to the point on the surface.